<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\AboutController;
use common\models\member\Member;
use common\models\category\Category;
use common\models\articles\Articles;
use common\models\art\Art;
use common\models\Fenhuigrade\Fenhuigrade;

    $fenhui = Fenhuigrade::find()->where(['status' => Fenhuigrade::STATUS_ACTIVE])->asArray()->limit(6)->all();
    $weiyuan = Articles::find()->where(['category_id' => 16, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(3)->all();
    $pinpai = Articles::find()->where(['category_id'=>23, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();

    $controllerID = Yii::$app->controller->id;
    $actionID = Yii::$app->controller->action->id;
?>
    <style>
        .divtoneulimg{
            margin-right: -33px;
        }
        .divtoneulimg li{
            margin-right: 36px;
        }
        .divtoneul{
            height: auto;
        }
        .divtoneul li{
            margin-bottom: 8px;
        }
    </style>

    <div class="content">
        <div class="w1200 clearFloat mb50">
           <h3 class="abouth3">当前位置：<a href="<?= yii\helpers\Url::to(['/']);?>">首页</a> > <a href="<?= yii\helpers\Url::to([$parentinfo['type'], 'id' => $parentid])?>"><?= $parenttitle;?></a> > <a><?= $title;?></a></h3>
            <div class="clearFloat">
                <div class="jjleft floatLeft">
                    <div class="clearFloat">
                        <h3 class="jjtitle"><?php echo $parenttitle; ?></h3>
                        <ul class="jjul">
                            <?php foreach($childcat as $t){ ?>
                            <li<?php if(("$controllerID".'/'."$actionID") == $t['type']) {echo ' class="jjactive"';} ?>>
                                <a href="<?= yii\helpers\Url::to([$t['type'], 'id' => $id]); ?>">
                                    <?php echo $t['name']; ?>
                                </a>
                            </li>
                            <?php } ?>
                       </ul>
                    </div>
                </div>
                <div class="jjmiddle floatLeft">
                    <div class="clearFloat">
                        <ul class="xhnews">
                            <?php foreach($articles as $k=>$t){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to([$ctype, 'id' => $t['id']]); ?>"><?=$t['title'];?></a>
                                <span><?= date('Y-m-d',$t['updated_at']);?></span>
                            </li>
                            <?php if($k%10 == 9){ ?>
                            <div class="ddline">
                            </div>
                            <?php }} ?>
                        </ul>
                        <div class="newpage mt50 mb50">
                                <?php if($page)
                                {
                                    echo LinkPager::widget([
                                    'maxButtonCount' => 6,
                                    'prevPageLabel' =>'&lt;',
                                    'nextPageLabel' =>'&gt;',
                                    'pagination'=>$page,
                                ]);
                                }
                                ?>
                        </div>
                    </div>
                </div>
                <div class="jjright floatRight">
                    <div class="clearFloat">
                        <h3 class="indexh3"><span>协会机构 </span></h3>
                        <ul class="divtoneulimg clearFloat">
                            <?php foreach($fenhui as $t) { ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $t['id']]); ?>">
                                    <img src="<?= yii::getAlias('@web');?>/upload/<?= json_decode($t['label_img'], true)['newname'];?>" alt="" width="72" height="72">
                                    <span><?= mb_substr(strip_tags($t['name']),0,4,'utf-8'); ?><?php if(strlen($t['name']) > 9) { echo '...'; } ?></span>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt35">
                        <h3 class="indexh3"><span>分支机构</span></h3>
                        <ul class="fzdiv mt35">
                            <?php foreach($weiyuan as $t) { ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $t['id']]); ?>">
                                    <?= mb_substr(strip_tags($t['title']),0,11,'utf-8'); ?><?php if(strlen($t['title']) > 34) { echo '...'; } ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt35">
                        <h3 class="indexh3"><span>品牌建设</span></h3>
                        <ul class="divtoneul">
                           <?php foreach($pinpai as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,11,'utf-8'); ?><?php if(strlen($vo['title']) > 34) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
    </div>